package com.haruhinav.service;

import com.haruhinav.entity.Wallpaper;
import com.haruhinav.entity.vo.ImageDetails;
import com.haruhinav.entity.vo.ResultVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;


public interface WallpaperService {

    /**
     * 上传壁纸后数据库插入相关数据
     * @param wallpaper
     * @return
     */
    int insert(Wallpaper wallpaper);

    /**
     * 分页获取壁纸
     * map key : list count
     * @param wallpaper
     * @return
     */
    Map<String,Object> limitWallpaper(Wallpaper wallpaper);
    /**
     * 上传壁纸
     * admin和用户公用
     * @param file
     * @param request
     * @param isAdmin
     * @return
     * @throws IOException
     */
    ResultVO upload(MultipartFile file, ImageDetails details, HttpServletRequest request, boolean isAdmin) throws IOException;

    /**
     * 修改
     * @return
     */
    Integer updateWallpaper(Wallpaper wallpaper);

    /**
     * 根据id删除
     * @param wallpaper
     * @return
     */
    Integer deleteWallpaper(Wallpaper wallpaper,HttpServletRequest request);

    /**
     * 批量删除by ids
     * @param ids
     * @return
     */
    Integer batchDeleteByIds(long[] ids,HttpServletRequest request);

    /**
     * 批量审核/下架
     * @return
     */
    Integer batchUpdateEnabled(long[] ids);

    /**
     * 查询md5值相同的数据
     * @return
     */
    List<Wallpaper> getWallpaperGroupByMd5();
}
